<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IGMVC.Web.Models.IssueListView>" %>
<%@ Import Namespace="IGMVC.Web.Views.Issues" %>
<%@ Import Namespace="IGMVC.Web.Helpers.UltraChart" %>
<%@ Register Assembly="Infragistics4.Web.v10.2, Version=10.2.20102.2002, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %>
<%@ Register Assembly="Infragistics4.WebUI.UltraWebChart.v10.2, Version=10.2.20102.2002, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.UltraChart" TagPrefix="igchart" %>
<%@ Register assembly="Infragistics.Web.Mvc" namespace="Infragistics.Web.Mvc" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Issues List
</asp:Content>

<asp:Content ContentPlaceHolderID="HeadContent" runat="server">
<style type="text/css">
#pgr-tmpl a {margin:4px;}
#severityChart
{
    position:relative;
    margin-top:35px;
}
</style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Issues List</h2>
    
    <%
        this.issues.DataSource = this.ViewData.Model.Issues;
        this.issues.Behaviors.Paging.PageIndex = this.ViewData.Model.PageIndex;
        this.issues.Behaviors.Paging.PageSize = this.ViewData.Model.PageSize;
        this.issues.DataBind();
    %>
    
    <ig:WebDataGrid ID="issues" 
        EnableAjax="false" 
        EnableViewState="false"
        AutoGenerateColumns="False" runat="server" Width="90%">
        <Columns>
            <ig:BoundDataField Header-Text="Title" DataFieldName="Title" Key="Title" />
            <ig:BoundDataField Header-Text="Description" DataFieldName="Description" Key="Description" />
            <ig:BoundDataField Header-Text="Severity" DataFieldName="Severity" Key="Severity" />
        </Columns>
        <Behaviors>
            <ig:Paging>
                <PagerTemplate>
                    <div id="pgr-tmpl"><%= Html.RenderIssuesGridPager(this.Model)%></div>                
                </PagerTemplate>
            </ig:Paging>
            <ig:ColumnResizing/>
            <ig:RowSelectors/>
            <ig:Selection/>
            <ig:Activation/>
        </Behaviors>
    </ig:WebDataGrid>
    
    <div id="severityChart">
        <h3>Issue Severity</h3>
        <%= Html.Chart(this.Model.IssueSeverity, "pie", ResolveUrl("~/Content/ChartImages/"))%>
    </div>
    
    <cc1:IGMvcScriptManager ID="sm" runat="server" />
</asp:Content>

<asp:Content ContentPlaceHolderID="DescriptionContent" runat="server">
    <h3>On this Page</h3>
    <p>This page features a WebDataGrid and the WebChart.</p>
    
    <h4>WebDataGrid</h4>
    <p>The grid has 
    many of the behaviors enabled that are normally available in a WebForms site.
    You may explore the behaviors by:</p>
    <ul>
        <li>Clicking on the far-left cell in a row to select the row</li>
        <li>Clicking on individual cells to select a cell</li>
        <li>Pressing the tab button to move from cell to cell</li>
        <li>Paging the grid</li>
        <li>Draging the right bound of a column header to resize the column</li>
    </ul>
    <p>With Activation, Selection, RowSelectors and ColumnResizing enabled the Infragistics client-side
    object model is available making interaction with the grid's data in the browser
    much easier. Further, many client-side events are firing each time a selection or active
    cell changes allowing you to extend the behavior of the grid.</p>
    
    <p>Want to add items to the grid? Fill out the <%= Html.ActionLink("new issue","Index","Issues") %>
    form and return to see your new issue in the list.</p>
    
    <p>The paging mechanism of this grid is made compatible with MVC controller actions by 
    using a custom pager template. The view is fed information about the context of the grid
    such as page size and total number of pages from a view model instance. Inside the view page 
    an extension method is used to generate action links for the pages.</p>
    
    <h4>WebChart</h4>
    <p>The WebChart in this application uses a preset file accessed from an extension method.
    The preset files are great ways to reuse chart and gauge settings among different instances.
    While this page uses the extension method to keep the sample clean, you may also choose to
    include the markup in your view page. Adding the markup directly into the page will allow 
    you to extend the client functionality of your charts even further.</p>
    
</asp:Content>
